3 ...\PTVR_Researchers\Python_Scripts\Demos\Pointing\
4 reticle_(3_ways_of_creating_a...).py
6 Goal: show three ways of creating a reticle corresponding to three different goals.
7 The 3 reticles are simultaneously displayed close together with
8 different perimetric coordinates.
9 They are Head-contingent in this demo.
11 Note 1 : The reticle belongs to the PTVR category called "flat cursors".
14 when using ImageFromLoading (),
15 the default is to use a file that is stored in:
16 ...\PTVR_Researchers\PTVR_Operators\resources\Images\
17 However, you can use the 'path_to_image_folder' parameter to get files
18 that are stored in paths outside of ...\PTVR_Researchers.
38 my_contingency = ImageContingency.HEADSET
45 my_world = The3DWorld ()
47 my_world.translate_coordinate_system_along_global ( np.array([0, 1.2, 0]))
48 my_scene = VisualScene ()
52 my_reticle_image = RG.ReticleImageFromDrawing ()
56 my_reticle_cursor = ImageToContingentCursor (
57 image = my_reticle_image,
58 contingency_type = my_contingency)
61 my_scene.place_contingent_cursor (my_reticle_cursor)
67 my_reticle_image_2 = SFD.ImageFromDrawing (
68 color = color.RGBColor ( g = 0.7),
69 shape =
"rectangle", line_width_as_ratio = 0.05 )
70 my_reticle_cursor_2 = ImageToContingentCursor (
71 image = my_reticle_image_2,
72 contingent_cursor_ecc_hm =
73 np.array ( [ 5, 90 ]),
74 contingency_type=my_contingency )
75 my_scene.place_contingent_cursor (my_reticle_cursor_2)
81 my_reticle_image_3 = SFL.ImageFromLoading (
85 image_file =
"mouse_cursor_blue_arrow.png" )
86 my_reticle_cursor_3 = ImageToContingentCursor (
87 image = my_reticle_image_3,
88 contingent_cursor_ecc_hm =
89 np.array ( [ 5, 270 ]),
90 contingency_type = my_contingency )
91 my_scene.place_contingent_cursor (my_reticle_cursor_3)
93 my_world.add_scene (my_scene)
96 if __name__ ==
"__main__":
def LaunchThe3DWorld(jsonFileCategory="Externals")